package com.example.demo.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.entity.DTO.RoleAndWorkersAndBeautyCareDTO;
import com.example.demo.entity.DTO.RoleDTO;
import com.example.demo.entity.Role;
import com.example.demo.mapper.RoleMapper;
import com.example.demo.service.IRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 角色表 服务实现类
 * </p>
 *
 * @author Mr.wyy
 * @since 2024-06-03
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IRoleService {

    @Autowired
    private RoleMapper roleMapper;

    @Override
    public RoleAndWorkersAndBeautyCareDTO selectRoleAndWorkersAndBeautyCare(Integer workersId) {
        return roleMapper.selectRoleAndWorkersAndBeautyCare(workersId);
    }

    @Override
    public List<Role> selectAllsRole() {
        return roleMapper.selectAllsRole();
    }

    @Override
    public Role selectRoleById(Integer roleId) {
        return roleMapper.selectRoleById(roleId);
    }

    @Override
    public int addRole(RoleDTO roleDTO) {
        return roleMapper.addRole(roleDTO);
    }

    @Override
    public int deleteRole(Integer roleId) {
        return roleMapper.deleteRole(roleId);
    }

    @Override
    public int updateRole(RoleDTO roleDTO) {
        return roleMapper.updateRole(roleDTO);
    }

}
